package service;

import java.util.List;

import pojo.Admin;
import dao.AdminDAO;

public class AdminService {
	private AdminDAO adminDAO=new AdminDAO();

	
	public Admin adminLogin(String username,String password){
		
		List<Admin> list=adminDAO.findByUsernameAndPassword(username,password);
		if (0 == list.size()) {
			return null;
		} else {
			Admin admin=list.get(0);
			return admin;
		}
	}
	
	public void setAdminDAO(AdminDAO adminDAO) {
		this.adminDAO = adminDAO;
	}

	public AdminDAO getAdminDAO() {
		return adminDAO;
	}
}
